package com.xu.base.enums;

import lombok.Getter;

/**
 * 状态枚举
 *
 * @Author: 许乾伟
 * @Date: 2024/3/21 10:06
 */
public enum StatusEnum {
    /**
     * 启用状态
     */
    ENABLED(true,"启用"),

    /**
     * 禁用状态
     */
    DISABLED(false,"停用");

    @Getter
    private boolean status;
    @Getter
    private String desc;

    StatusEnum(boolean status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    /**
     * 翻译枚举状态
     * @param status
     * @return
     */
    public static String getByStatus(Boolean status){
        return status ? ENABLED.desc : DISABLED.desc;
    }

}
